from django.conf.urls import url,include
from django.contrib import admin
from .views import *


urlpatterns = [
    url(r"^register/$", Register.as_view(), name="register"),
    # 注册页面路由
    url(r"^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$", CheckUserName.as_view()),
    # 判断用户名重复路径
    url(r"^mobiles/(?P<mobile>1[345789]\d{9})/count/$", CheckMobile.as_view()),
    # 判断手机号重复路径
    url(r"^login/$",Login.as_view()),
    # 用户登陆界面
    url(r"^logout/$",Logout.as_view()),
    # 用户退出界面
    url(r"^info/$",UserInfo.as_view(),name="info"),
    # 用户中心路由
    url(r"^emails/$",EmailDeal.as_view()),
    # email处理路由
    url(r"^verify_email/$",EmailRegister.as_view(),name="email"),
    # 邮箱注册路由
    url(r"^addresses/$", AddressesShow.as_view()),
    # 获取收货地址网页路由
    url(r"^addresses/create/",CreateAddress.as_view()),
    url(r"^verify_email/$",EmailRegister.as_view(),name="email"),
    # 邮箱注册路由
    # 获取收货地址网页路由
    url(r"^addresses/create/", CreateAddress.as_view()),
    # 新增收货地址路由
    url(r"^addresses/(?P<id>\d+)/$",ChangeAddress.as_view()),
    # 修改地址路由
    url(r"^addresses/(?P<id>\d+)/default/$",SetDefaultAddress.as_view()),
    # 设置默认地址路由
    url(r"^addresses/(?P<id>\d+)/title/$",ChangeAddressTitle.as_view()),
    # 修改地址标题
    url(r"^password/$",ChangePassword.as_view()),
    # 修改密码路由
    url(r"^browse_histories/$", BrowseHistories.as_view()),
    # 商品浏览记录
    url(r"find_password/$",ForgetPassword.as_view()),
    # 忘记密码视图
    url(r"^accounts/(?P<username>[a-zA-Z0-9_-]{5,20})/sms/token/",RetrievePassword.as_view()),
    # 找回密码视图
    url(r"^sms_codes/$",SendSMSCode.as_view()),
    # 发送短信验证码视图
    url(r"^accounts/(?P<mobile>1[345789]\d{9})/password/token/$",VerificationSMSCode.as_view()),
    # 验证sms_code
    url(r"^users/(?P<user_id>\d+)/password",AppendPassword.as_view()),
    # 新增密码视图
]


